﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WorkflowCore.Interface;

namespace MyMES.Read.API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class WorkflowController : ControllerBase
    {
    //    private readonly IWorkflowHost _workflowHost;

    //    public WorkflowController(IWorkflowHost workflowHost)
    //    {
    //        _workflowHost = workflowHost;
    //    }

    //    [HttpPost("start")]
    //    public async Task<IActionResult> StartWorkflow([FromBody] LeaveApprovalData data)
    //    {
    //        var id = await _workflowHost.StartWorkflow("LeaveApprovalWorkflow", 1, data);
    //        return Ok(new { WorkflowId = id });
    //    }
    //    [HttpPost("start2")]
    //    public async Task<IActionResult> StartWorkflow([FromBody] ApprovalRequest data)
    //    {
    //        //var approvalRequest = new ApprovalRequest
    //        //{
    //        //    Id = Guid.NewGuid().ToString(),
    //        //    Requestor = "User1",
    //        //    CurrentApprover = "Manager1",
    //        //    Status = "Pending",
    //        //    CurrentStep = 1
    //        //};
    //        var approvalRequest = data;
    //        approvalRequest.Id = Guid.NewGuid().ToString();
    //        var id = await _workflowHost.StartWorkflow("MultiLevelApprovalWorkflow", approvalRequest);
    //        return Ok(new { WorkflowId = id });
    //    }
    }
}
